<#macro quotaplan plan>
<style>
body{
  margin:0;
  padding:0;
}
table {
	border-spacing: 1px;
	border: 0px solid #A2C0DA;
	width:100%;	
}
.ptype{
    margin-left:-20px; 
}
td,th {
/**
	padding: 2px 5px;
	border-collapse: collapse;
	text-align: left;
	font-weight: normal;
*/
}

thead tr th {
	background: #B0D1FC;
	border: 1px solid #ccc;
}

thead tr th.line1 {
	background: #D3E5FD;
}

thead tr th.line4 {
	background: #C6C6C6;
}

tbody tr td {
	background: #CBE2FB;
	border: 1px solid #ddd;
	vertical-align: top;
}
tbody tr td input{
    width:100%;
    height:100%;
}
tbody tr td textarea{
    width:100%;
    height:18px;
}

tbody tr td.line4 {
	background: #D5D6D8;
}

tbody tr th {
	background: #DFEDFF;
	border: 1px solid #bbb;
	vertical-align: top;
}
.pbutton{
    background-color:#dea;  
    border:#dae 1px solid;
    width:80px;
    height:25px;
    font-size:16px;
}
.pbuttonsave{
    background-color:#Fee;  
    border:#dae 1px solid;
    width:80px;
    height:25px;
    font-size:16px;
}
</style>
<form>
<input type="hidden" name="bean.name" value="${plan.name}"/>
<input type="hidden" name="bean.createDate" 
value="${plan.createDate.time?string("yyyy-MM-dd HH:mm:ss")}"/>
<input type="hidden" name="bean.updateDate" 
value="${plan.updateDate.time?string("yyyy-MM-dd HH:mm:ss")}"/>
<input type="hidden" name="bean.maker.username" value="${plan.maker.username}"/>
<input type="hidden" name="bean.monthed" value="${plan.monthed?string}"/>
<input type="hidden" name="bean.duration" value="${plan.duration}"/>
<table align="left" cellspacing="1">
<caption>${plan.department.name} ${plan.name}</caption>
	<thead>
		<tr>
			<th class="line1" width="8%" scope="col">
				代码
			</th>
			<th width="10%" scope="col">
				名称
			</th>
			<th width="6%" scope="col">
				单位
			</th>
			<th width="6%">
			   总值
			</th>		
			<th colspan="3" scope="col">
				分月计划
			</th>
			<th width="15%" scope="col">
				备注
			</th>
			<th class="line4" width="2%" scope="col">
				删
			</th>
		</tr>
		<tr>
			<th>
				&nbsp;
			</th>
			<th>
				&nbsp;
			</th>
			<th>
				&nbsp;
			</th>			
			<th>
				&nbsp;
			</th>			
			<th width="5%">
				第1个月
			</th>
			<th width="5%">
				第2个月
			</th>
			<th width="5%">
				第3个月
			</th>
			<th>
				&nbsp;
			</th>
			<th>
				&nbsp;
			</th>
		</tr>
	</thead>
	<tbody>
	<#list plan.dataItems as item >
       <tr>
       <td>
       <input name="bean.dataItems[${item_index}].code" value="${item.code}"/>
       </td>
       <td>
       <input name="bean.dataItems[${item_index}].name" value="${item.name}" readonly="readonly" />
       </td>
       <td>
        <input name="bean.dataItems[${item_index}].unit" value="${item.unit}" readonly="readonly" />
       </td>
       <td>
         ${item.value}
       </td>
       <#assign mvs = item.monthValue?values>
       <#list mvs as val>
        <td>
           <input name="bean.dataItems[${item_index}].monthValue[${val_index}]" value="${val}" />
        </td>
      </#list>       
       <td>
       <textarea name="bean.dataItems[${item_index}].remark">${item.remark}</textarea>
       </td>
       <td>
         
          <img width="17" height="17" style="cursor: hand;" src="${base}/images/remove.gif"
            onclick="removeMe(this)"
          />
       </td>
       
       </tr>
	</#list>
	</tbody>
	<tfoot>
	    <tr>
	      <td style="background:#fc3" colspan="8" align="right">
	        ${plan.outputValue} 万元
	      </td>
	    </tr>
		<tr>
			<td>
				<button class="pbutton" onclick="addItem(this);" type="button">
					添加项目
				</button>
			</td>
			<td>
				<button class="pbuttonsave" onclick="saveplain();" type="button">
					保存计划
				</button>
			</td>
			<td>
				&nbsp;
			</td>
			<td>
				&nbsp;
			</td>
			<td>
				&nbsp;
			</td>
			<td>
				&nbsp;
			</td>
			<td>
				&nbsp;
			</td>		
			<td>
				&nbsp;
			</td>
		</tr>
	</tfoot>
</table>
</form>
<script type='text/javascript'>
  function removeMe(obj){
    var r = $(obj).parent().parent();
    r.remove();
  }
</script>
</#macro>